<?php
class Exts_Models_Resources extends Exts_Db_Table_Abstract
{
    protected $_name = 'acl_resources';
    protected $_primary = 'id';

    public function getIdByName( $name )
    {
        $row = $this->fetchRow( 
			$this->select()->where('name=?', strtolower( $name))
		);
        if( ! count( $row )) {
            $row = $this->createRow();
            $row->name = strtolower( $name );
            return $row->save();

        }
        return $row->id;
    }

}
